﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using K9Nano.Events.Entity;

namespace K9Nano.Domain
{
    [Table("AppAuditLog")]
    [CacheDisabled]
    [EventDisabled]
    public class AuditLog: Entity<Guid>, IMayHaveTenant
    {
        [Required]
        [StringLength(255)]
        public string Event { get; set; }

        [Required]
        [StringLength(255)]
        public string EventId { get; set; }
        
        [Required]
        [Column(TypeName = "JSON")]
        public string Data { get; set; }
        
        public string UserId { get; set; }

        [StringLength(50)]
        public string UserFullName { get; set; }

        public Guid? TenantId { get; set; }

        [Required]
        [StringLength(50)]
        public string ApiName { get; set; }

        [Required]
        public DateTimeOffset AuditTime { get; set; }

        [Required]
        public int Status { get; set; }

        [Required]
        public string Url { get; set; }
    }
}